package com.sh_rw.label.common.black;

import com.sh_rw.label.CheckUtils;
import com.sh_rw.label.listener.BlackRules;

/**
 * 密码处理器
 * Created by rw-duke on 2018/4/4.
 */

public class BlackHandler extends Black {
    private int passworld = 0;
    private final int rules0 = 0;//明码
    private final int rules1 = 1;
    private final int rules2 = 2;
    private final int rules3 = 3;
    private final int rules4 = 4;

    @Override
    public byte[] onBlackHandler(byte[] src) {
        if (CheckUtils.checkPacket(src)) {
            passworld = src[12] & 0xff;
            switch (passworld) {
                case rules0:
                    return src;
                default:
                    return src;
            }
        }
        return new byte[0];
    }
}
